Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
npm install metautil
const metautil = require('metautil')
toBool = [() => true, () => false]
const created = await mkdir(path).then(...toBool);
timeout(msec: number, signal?: AbortSignal): Promise<void>
delay(msec: number, signal?: AbortSignal): Promise<void>
timeoutify(promise: Promise<unknown>, msec: number): Promise<unknown>
cryptoRandom(min?: number, max?: number): number
random(min?: number, max?: number): number
generateUUID(): string
generateKey(length: number, possible: string): string
crcToken(secret: string, key: string): string
generateToken(secret: string, characters: string, length: number): string
validateToken(secret: string, token: string): boolean
serializeHash(hash: Buffer, salt: Buffer): string
deserializeHash(phcString: string): HashInfo
hashPassword(password: string): Promise<string>
validatePassword(password: string, serHash: string): Promise<boolean>
md5(fileName: string): Promise<string>
getX509(cert: X509Certificate): Strings
duration(s: string | number): number
nowDate(date?: Date): string
nowDateTimeUTC(date?: Date, timeSep?: string): string
parseMonth(s: string): number
parseDay(s: string): number
parseEvery(s: string): Every
nextEvent(every: Every, date?: Date): number
Error
constructor(message: string, code: number)
isError(instance: object): boolean
directoryExists(path: string): Promise<boolean>
ensureDirectory(path: string): Promise<boolean>
parseHost(host?: string): string
parseParams(params: string): Cookies
parseCookies(cookie: string): Headers
parseRange(range: string): StreamRange
fetch(url: string, options?: FetchOptions): Promise<Response>
receiveBody(stream: IncomingMessage): Promise<Buffer | null>
ipToInt(ip?: string): number
httpApiCall(url: string, options: ApiOptions): Promise<object>
makePrivate(instance: object): object
protect(allowMixins: Strings, ...namespaces: Namespaces): void
jsonParse(buffer: Buffer): Dictionary | null
isHashObject(o: string | number | boolean | object): boolean
flatObject(source: Dictionary, fields: Strings): Dictionary
unflatObject(source: Dictionary, fields: Strings): Dictionary
getSignature(method: Function): Strings
namespaceByPath(namespace: Dictionary, path: string): Dictionary | null
serializeArguments(fields: Strings, args: Dictionary): string
constructor(options: { timeout?: number })
items: Array<unknown>
free: Array<boolean>
queue: Array<unknown>
current: number
size: number
available: number
timeout: number
next(): Promise<unknown>
add(item: unknown): void
capture(): Promise<unknown>
release(item: unknown): void
isFree(item: unknown): boolean
sample(array: Array<unknown>): unknown
const cards = ['🂡', '🃒', '🂮', '🂷', '🃚'];
const card = sample(cards);
shuffle(array: Array<unknown>): Array<unknown>
const players = [{ id: 10 }, { id: 12 }, { id: 15 }];
const places = shuffle(players);
projection(source: object, fields: Array<string>): Array<unknown>
const player = { name: 'Marcus', score: 1500, socket };
const playerState = projection(player, ['name', 'score']);
constructor(concurrency: number, size?: number, timeout?: number)
concurrency: number
counter: number
timeout: number
size: number
empty: boolean
queue: Array<QueueElement>
enter(): Promise<void>
leave(): void
replace(str: string, substr: string, newstr: string): string
between(s: string, prefix: string, suffix: string): string
split(s: string, separator: string): [string, string]
isFirstUpper(s: string): boolean
isFirstLower(s: string): boolean
isFirstLetter(s: string): boolean
toLowerCamel(s: string): string
toUpperCamel(s: string): string
toLower(s: string): string
toCamel(separator: string): (s: string) => string
spinalToCamel(s: string): string
snakeToCamel(s: string): string
isConstant(s: string): boolean
fileExt(fileName: string): string
parsePath(relPath: string): Strings
trimLines(s: string): string
bytesToSize(bytes: number): string
sizeToBytes(size: string): number
Copyright (c) 2017-2023 Metarhia contributors.
Metautil is MIT licensed.
Metautil is a part of Metarhia technology stack.
[3.15.0][] - 2023-10-21
FAQs
Metarhia utilities
The npm package metautil receives a total of 182 weekly downloads. As such, metautil popularity was classified as not popular.
We found that metautil demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.